<?php
//Author Jec Castillo 
//Pinoytuner....
require_once('m_ajax.php');

	
$function = $_POST['function'];
$ulevel = $_POST['ulevel'];
$uid = $_POST['uid'];
	
$chat =  new chat($ulevel,$uid);

	
	
		
	switch($function)
	{
				
		case 'send'://send
			$chat->message_send();
			break;
		
		case 'showHistory':
			$chat->show_history();
			break;
	   		
		case 'getMaxId':
			$chat->get_max_id();
		
		break;  	
			
		case 'update'://update
			$chat->message_update();
			break;
		
		case 'disconnect'://disconnect
			$chat->remove_nickname();
				
		break;   
	
	
	
	} 
	
	
	
echo json_encode($chat->data);
?>